package exam.meituan;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main test = new Main();
        test.myans3();
    }

    public void myans1(){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        boolean[][] map = new boolean[1000][1000];

        for(int i = 0;i<N;i++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            map[x][y] = true;
        }
//        Math.sqrt();
    }

    public void myans2(){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] colors = new int[N];
        int K = sc.nextInt();
        for(int i = 0;i<N;i++){
            colors[i] = sc.nextInt();
        }
        int ans = 0;
        for(int i = 0;i<N;i++){
            Map<Integer,Integer> hashmap = new HashMap<>();
            int j = i;
            while (hashmap.size() != K+1){
                if(!hashmap.containsKey(colors[j]) && hashmap.size() == K){
                    break;
                }
                hashmap.put(colors[j],hashmap.getOrDefault(colors[j],0)+1);
                j++;
                if(j == N){
                    break;
                }
            }
            int len = 0;
            for(int val : hashmap.values()){
                len += val;
            }
            ans = Math.max(ans,len);
        }
        System.out.println(ans);
    }

    public void myans3(){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        char[] strs = str.toCharArray();
        int n = strs.length;
        int update = 0;
        if(isStr(str)){
            for(int i = 0;i< n/2;i++){
                if(strs[i] != 'a'){
                    strs[i] = 'a';
                    strs[strs.length-i-1] = 'a';
                    System.out.println(String.valueOf(strs));
                }
            }
        }else {
            for(int i=0,j=strs.length-1;i<=j;i++,j--){
                if(strs[i] == strs[j]){
                    continue;
                }else {
                    if(strs[i] < strs[j]){
                        strs[j] = strs[i];
                    }else {
                        strs[i] = strs[j];
                    }
                    update++;
                }
                if(update == 2){
                    System.out.println(String.valueOf(strs));
                }
            }
        }
        if(update == 1){
            int i = strs.length/2+1;
            strs[i] = 'a';
            System.out.println(String.valueOf(strs));
        }
    }

    public boolean isStr(String str){
        char[] chars = str.toCharArray();
        for(int i = 0,j = chars.length-1;i<=j;i++,j--){
            if(chars[i] != chars[j]){
                return false;
            }
        }
        return true;
    }
}
